extends Control

onready var findBtn = $TextureButton

signal onSelect(text)

onready var textEdit = $TextEdit
# Called when the node enters the scene tree for the first time.
func _ready():
	pass

	
	

func _on_TextureButton_pressed():
	doFind()
	
func doFind():
	var text = textEdit.get_text()
	emit_signal('onSelect',text)


func clearText():
	textEdit.set_text("")
	

func _on_TextEdit_text_changed():
	var text = textEdit.get_text()
	if text.find("\n") >= 0 : 
		text = text.replace("\n", "")
		textEdit.set_text(text)
		textEdit.cursor_set_column(text.length())
	doFind()
